package com.doradance.main.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.doradance.R;

public class MainActivity extends AppCompatActivity
{
    private Button mButtonStartUISDK;
    private Button mButtonStartAPISDK;

    private View.OnClickListener mOnClickListener=new View.OnClickListener()
    {
        @Override
        public void onClick(View view)
        {
            switch (view.getId())
            {
                case R.id.button_start_ui_sdk:
                    Intent mIntent=new Intent(MainActivity.this,HpplayUISDKActivity.class);
                    mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    MainActivity.this.startActivity(mIntent);
                    MainActivity.this.finish();
                    break;
                case R.id.button_start_api_sdk:
                    Intent mApiIntent=new Intent(MainActivity.this,HpplayAPISDKActivity.class);
                    mApiIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    MainActivity.this.startActivity(mApiIntent);
                    MainActivity.this.finish();
                    break;
            }
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_main_2);

        mButtonStartUISDK=(Button)this.findViewById(R.id.button_start_ui_sdk);
        mButtonStartAPISDK=(Button)this.findViewById(R.id.button_start_api_sdk);

        mButtonStartUISDK.setOnClickListener(mOnClickListener);
        mButtonStartAPISDK.setOnClickListener(mOnClickListener);
    }
}
